export function shareFileMessage(options) {
    return new Promise(resolve => {
        
        uni.showLoading()
        
        const handleFail = error => {
            uni.hideLoading()
            resolve({
                success: false, message: error.errMsg
            })
        }
        
        const handleSuccess = () => {
            uni.hideLoading()
            resolve({
                success: true
            })
        }
        
        wx.downloadFile({
            url: options.url,
            header: options.header,
            success: res => {
                wx.shareFileMessage({
                    filePath: res.tempFilePath,
                    success: handleSuccess,
                    fail: handleFail,
                })
            },
            fail: handleFail
        })
        
    })
}